import request from "@/utils/request"

// 登录
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function login(data: unknown) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

// 注册
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function signup(data: unknown) {
  return request({
    url: '/user/signup',
    method: 'post',
    data
  })
}

// 获取用户信息
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function getStatus() {
  return request({
    url: '/user/status',
    method: 'get',
  })
}

// 退出登录
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function logout() {
  return request({
    url: '/user/logout',
    method: 'get'
  })
}

// 上传头像
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function uploadAvator(data: unknown) {
  return request({
    url: '/bfs/upload-avatar',
    method: 'post',
    data
  })
}

// 修改昵称
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function changeNickname(params: unknown) {
  return request({
    url: '/user/change-nickname',
    method: 'get',
    params
  })
}